home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD005b.dsk
/
CALENDAR.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
6KB
|
184 lines
90 REM CALENDAR PROGRAM
100 REM LIMITS OF CALENDAR
120 REM FROM 2-MARCH-1700
140 REM TO 31-JAN-2100<CTRL-J>
160 HOME : PRINT : PRINT
180 DIM M$(12),J(12)
200 REM <CTRL-J>--DATA SECTION--<CTRL-J>
220 DATA "JAN",31,"FEB",28,"MAR",31
240 DATA "APR",30,"MAY",31,"JUN",30
260 DATA "JUL",31,"AUG",31,"SEP",30
280 DATA "OCT",31,"NOV",30,"DEC",31
300 DATA SUNDAY,MONDAY,TUESDAY
320 DATA WEDNESDAY,THURSDAY
340 DATA FRIDAY,SATURDAY
360 REM <CTRL-J>--READ SECTION--<CTRL-J>
380 FOR K = 1 TO 12
400 READ M$(K),J(K)
420 NEXT K
440 FOR K = 0 TO 6
460 READ B$(K)
480 NEXT K
500 REM <CTRL-J>--MAIN PROGRAM--<CTRL-J>
520 CALL -936: INVERSE : VTAB 24
540 FOR K = 1 TO 40: PRINT " ";: GOSUB 3620: NEXT K
560 FOR K = 1 TO 9: PRINT "*<";: GOSUB 3620: NEXT K
580 PRINT "DATE";: FOR K = 1 TO 9: PRINT ">*";: GOSUB 3620
600 NEXT K
620 FOR K = 1 TO 40: PRINT " ";: GOSUB 3620: NEXT K: NORMAL
640 FOR K = 1 TO 20: PRINT : GOSUB 3620
660 PRINT "JAN 1982 MARK 4.1"
680 FOR K = 1 TO 16: PRINT : GOSUB 3620
700 NEXT K
720 VTAB 10: PRINT " <1>--A CALENDAR"
740 GOTO 2960
760 HOME : PRINT
780 FLAG = 0:U = 0
800 HOME : PRINT
820 PRINT "ENTER THE MONTH"; TAB( 20);
840 INPUT P$: PRINT
860 P$ = LEFT$(P$,3)
880 FOR M = 1 TO 12
900 IF P$ = M$(M) THEN 960
920 NEXT M
940 GOTO 820
960 PRINT "DO YOU WANT THE"
980 PRINT " YEAR CALCULATED"
1000 INPUT " (Y/N) ?";A$
1020 PRINT
1040 PRINT : PRINT "ENTER THE DAY"
1060 PRINT " OF THE MONTH"; TAB( 20);
1080 INPUT D: PRINT
1100 IF D = 29 AND P$ = "FEB" THEN 1180
1120 IF D <1 THEN 1160
1140 IF J(M) = >D THEN 1240
1160 PRINT "REALISTIC NUMERIC INPUT IS REQUIRED.": GOTO 1040
1180 INVERSE : PRINT " <CTRL-G>SPECIAL CASE<CTRL-G> ": NORMAL
1200 PRINT
1220 FLAG = 1
1240 A$ = LEFT$(A$,1)
1260 IF A$ = "Y" THEN 1560
1280 GOSUB 3200
1300 PRINT "ENTER THE YEAR"; TAB( 20);: INPUT Y
1320 IF P$ < >"FEB" THEN 1440
1340 IF D <29 THEN 1440
1360 IF Y = 2000 THEN GOTO 1440
1380 IF FLAG = 1 AND Y/100 = INT(Y/100) THEN 1420
1400 IF FLAG = 1 AND Y/4 = INT(Y/4) THEN 1440
1420 PRINT : PRINT "PLEASE ENTER A ";: INVERSE : PRINT " LEAPYEAR ": NORMAL : PRINT : GOTO 1300
1440 PRINT : PRINT
1460 GOSUB 3280
1480 PRINT TAB( 3);P$;" ";D","Y;" IS A ";
1500 INVERSE : PRINT " "B$(E)" ": NORMAL
1520 IF X = -1 THEN GOTO 2840
1540 VTAB 24: HTAB 4: PRINT "HIT RETURN TO CONTINUE";: GET A$: GOTO 2920
1560 GOSUB 3200
1580 PRINT "TYPE IN THE"
1600 PRINT " DAY OF THE WEEK"; TAB( 20);
1620 INPUT W$: PRINT : PRINT
1640 W$ = LEFT$(W$,2)
1660 FOR K = 0 TO 6
1680 Z$(K) = LEFT$(B$(K),2)
1700 NEXT K
1720 FOR K = 0 TO 6
1740 IF W$ = Z$(K) THEN 1840
1760 NEXT K
1780 PRINT "TYPE THE FIRST 2 LETTERS"
1800 PRINT " OF THE DAY OF THE WEEK": PRINT
1820 GOTO 1580
1840 IF FLAG = 1 THEN Q = 4
1860 IF FLAG = 0 THEN Q = 1
1880 FOR Y = 1996 TO 1801 STEP -Q
1900 IF Q = 4 AND Y = 1900 THEN 2040
1920 GOSUB 3320
1940 IF U = 8 THEN PRINT
1960 IF U = 8 THEN U = 0
1980 IF E = K THEN INVERSE : PRINT Y;: NORMAL : PRINT " ";
2000 J(2) = 28
2020 IF E = K THEN U = U +1
2040 NEXT Y
2060 VTAB 22: HTAB 4: PRINT "HIT RETURN TO CONTINUE";: GET A$
2080 GOTO 2920
2100 REM --<CTRL-J>BLANK SCREEN--<CTRL-J>
2120 CALL -936
2140 PRINT : PRINT : PRINT
2160 REM <CTRL-J>--CALENDAR INPUT--<CTRL-J>
2180 J(2) = 28
2200 PRINT "TYPE IN THE DATE, USING THIS FORM": PRINT
2220 INPUT " 25,JAN,1981 ";D,P$,Y
2240 GOSUB 3660
2260 GOSUB 3200
2280 GOSUB 3280
2300 IF D >J(M) THEN PRINT : INVERSE : PRINT " TOO MANY DAYS ": NORMAL : PRINT : GOTO 2200
2320 IF D <1 THEN PRINT : PRINT "THERE MUST BE SOME DAYS IN THIS MONTH": PRINT : GOTO 2200
2340 REM <CTRL-J>--CALENDAR HEADING--<CTRL-J>
2360 PRINT
2380 PRINT "THAT DAY FALLS ON A ";
2400 INVERSE : PRINT "<<"B$(E)">>"
2420 NORMAL
2440 IF Q = -1 THEN Q = -2: PRINT : PRINT : GOTO 2200
2460 IF Q = -2 THEN D1 = ABS(D1 -W)
2480 IF Q = -2 THEN PRINT : PRINT "THERE ARE ";D1" DAYS BETWEEN DATES": PRINT : GOTO 1540
2500 PRINT : PRINT : PRINT
2520 REM <CTRL-J>--PRINT A CALENDAR--<CTRL-J>
2540 PRINT TAB( 15);M$(M);" ";Y: PRINT
2560 D1 = 1: GOSUB 3200
2580 GOSUB 3280: GOSUB 3560
2600 PRINT " SUN MON TUE WED THU FRI SAT": PRINT
2620 FOR K = 1 TO J(M)
2640 IF K >9 THEN D1 = 0
2660 PRINT TAB( 4 +(5 *S) +L +D1);
2680 IF K = D THEN INVERSE
2700 PRINT K;: NORMAL
2720 L = L +5
2740 IF S *5 +L >30 THEN L = 0
2760 IF L = 0 THEN PRINT " "
2780 IF L = 0 THEN S = 0
2800 NEXT K
2820 L = 0
2840 PRINT : IF X = -1 THEN PRINT : PRINT "DATE MAY NOT BE CORRECT, YOU ARE OUT OF THE RANGE OF THIS PROGRAM !!!"
2860 PRINT : PRINT : PRINT "PRESS ANY KEY TO CONTINUE";
2880 GET A$: HOME : PRINT : PRINT
2900 REM <CTRL-J>--MAIN MENU--<CTRL-J>
2920 Q = 0:D1 = 0
2940 CALL -936: VTAB 4: PRINT " <1>--ANOTHER CALENDAR"
2960 PRINT : PRINT " <2>--FIND DAYS OF THE WEEK"
2980 PRINT : PRINT " <3>--DAYS BETWEEN DATES
3000 PRINT : PRINT " <4>--QUIT"
3020 INPUT " WHICH ";K
3040 IF K <1 THEN GOTO 2920
3060 IF K = 1 THEN GOTO 2120
3080 IF K = 2 THEN GOTO 760
3100 IF K = 3 THEN Q = -1: GOTO 2120
3120 PRINT : PRINT : PRINT " GOOD BYE"
3160 END
3180 REM <CTRL-J>--SUBROUTINE I--<CTRL-J>
3200 IF M <3 THEN N = M +13:G = 1
3220 IF M >2 THEN N = M +1:G = 0
3240 RETURN
3260 REM <CTRL-J>--SUBROUTINE II--<CTRL-J>
3280 A1 = Y/1000 - INT(Y/1000)
3300 IF A1 = 0 THEN J(2) = 29: GOTO 3400
3320 A2 = Y/100 - INT(Y/100)
3340 IF A2 = 0 THEN GOTO 3400
3360 A3 = Y/4 - INT(Y/4)
3380 IF A3 = 0 THEN J(2) = 29
3400 W = INT((Y -G) *365.25) + INT((N *30.6) +.01)
3420 S = W -621048
3440 W = W +D -621049
3460 IF D1 = 0 THEN D1 = W
3480 E = INT(((W/7) - INT(W/7)) *7 +.01)
3500 IF W <0 OR W >146070 THEN X = -1
3520 RETURN
3540 REM <CTRL-J>--SUBROUTINE III--<CTRL-J>
3560 S = INT(((S/7) - INT(S/7)) *7 +.05)
3580 RETURN
3600 REM <CTRL-J>--SUBROUTINE IV--<CTRL-J>
3620 FOR J = 1 TO 30: NEXT J
3640 RETURN
3660 REM <CTRL-J>--SUBROUTINE V--<CTRL-J>
3680 P$ = LEFT$(P$,3)
3700 FOR M = 1 TO 13: IF P$ = M$(M) THEN RETURN
3720 NEXT M
3740 IF M = 13 THEN POP : GOTO 2200
3760 RETURN